<template>
    <h1>proVideB</h1>
    <div class="box"></div>
    <button @click="handleClick">点我修改</button>
    <hr>
</template>
<script setup lang="ts">
import {inject} from "vue";
import type {Ref} from 'vue'

const bgColor = inject<Ref<string>>("color")
const handleClick = ()=> {
    bgColor!.value = 'yellow'
}

</script>

<style scoped lang="scss">
.box {
    width: 50px;
    height: 50px;
    border: 1px solid #000;
    margin-bottom: 20px;
    background: v-bind(bgColor);
}
</style>
